﻿using System.Data.Objects;
using Freetour.Application.Models.Membership;

namespace Freetour.Application.Persistence.Repositories.Membership
{
    public class MembershipRepositoryContext : ObjectContext
    {
        public MembershipRepositoryContext()
            : base("name=MembershipContainer", "MembershipContainer")
        {
        }

        private ObjectSet<MembershipEntity> _memberships;

        public ObjectSet<MembershipEntity> Memberships
        {
            get 
            {
                if (_memberships == null)
                {
                    _memberships = CreateObjectSet<MembershipEntity>();
                }
                return _memberships;
            }
        }

        private ObjectSet<PersonalInfoEntity> _personalInfoes;

        public ObjectSet<PersonalInfoEntity> PersonalInfoes
        {
            get
            {
                if (_memberships == null)
                {
                    _personalInfoes = CreateObjectSet<PersonalInfoEntity>();
                }
                return _personalInfoes;
            }
        }
    }
}
